using UnityEngine;
using UnityEngine.UI;
using QFramework;
using ProjectSurvivor;
using UnityEngine.SceneManagement;
using QAssetBundle;

namespace QFrameworkSurvivor
{
	public class UIGameStartPanelData : UIPanelData
	{
	}
	public partial class UIGameStartPanel : UIPanel,IController
	{
		protected override void OnInit(IUIData uiData = null)
		{
            mData = uiData as UIGameStartPanelData ?? new UIGameStartPanelData();
			// please add init code here
            Global.ExpPercent.Value.LogInfo();
            Global.CoinPercent.Value.LogInfo();
            BtnCoinUpgrade.onClick.AddListener(() => 
			{
                AudioKit.PlaySound(Sfx.BTNCLICK);
                CoinUpgradePanel.Show();
            });

			BtnAchivement.onClick.AddListener(() =>
			{
                AudioKit.PlaySound(Sfx.BTNCLICK);
                AchivementPanel.Show();
            });

            BtnStartGame.onClick.AddListener(() =>
            {
                AudioKit.PlaySound(Sfx.BTNCLICK);
                Time.timeScale = 1;
				Global.ResetData();
                this.CloseSelf();
                SceneManager.LoadScene("Game");
            });


			this.GetSystem<CoinUpgradeSystem>().Say();
        }
		
		protected override void OnOpen(IUIData uiData = null)
		{
		}
		
		protected override void OnShow()
		{
		}
		
		protected override void OnHide()
		{
		}
		
		protected override void OnClose()
		{
		}

        public IArchitecture GetArchitecture()
        {
            return Global.Interface;
        }
    }
}
